home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************
- File: ATMDLPI.h
-
- Contains: ATM Open Transport Streams DLPI PCI driver Header
-
- Written by:
-
- Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- To Do:
- ***********************************************************/
-
- #ifndef __ATMDLPI__
- #define __ATMDLPI__
-
- /***********************************************************
- INCLUDES
- ***********************************************************/
-
- #include <OpenTptModule.h>
- #include <OpenTptDevLinks.h>
- #include <OpenTptAtm.h>
-
- #include <OpenTptPCISupport.h>
-
- #include <miioccom.h>
- #include <stropts.h>
- #include <dlpi.h>
-
- #include <Kernel.h>
- #include <DriverServices.h>
- #include <Devices.h>
- #include <CodeFragments.h>
-
- /***********************************************************
- DEFINES
- ***********************************************************/
-
- /* Read and Write queue water marks */
- #define kQueueHighMark 32768
- #define kQueueLowMark 128
-
- /* Maximum number of minor devices per port supported */
- #define MAX_MINORDEVICES 256
-
- /* Maximum number of connections per port supported */
- #define MAX_CONNECTIONS 256
-
- #define kMaxPendingRecvMessages 10
-
- /***********************************************************
- STRUCTS AND TYPEDEFS
- ***********************************************************/
-
- /*
- * Internal Return codes for DLPI message handling routines
- */
- enum DLPIInternalCodes {
- kdlpiDONE = 1,
- kdlpiRETRY = 2
- };
-
- /*
- * Special return codes fo ABCVendorTransmit() routine
- */
- enum ATMTransmitReturnCodes {
- kFlowControl = 1
- };
-
- /*
- * Write Scheduler Types
- */
- enum DLPISchedulerTypes {
- kdlpiBufcallType = 1,
- kdlpiTimerType = 2
- };
-
- /*
- * VC types for flags field in ConnectTableEntry structure
- */
- enum ATMVCITypes {
- kVCIIn = 0x00000001,
- kVCIOut = 0x00000002
- };
-
- struct _ABCVendorCardSpecific;
-
- struct _ConnectTableEntry;
- struct _MinorDeviceTableEntry;
- struct _PortTableEntry;
-
- /*
- * ConnectTableEntry, one per VC
- */
- struct _ConnectTableEntry {
- UInt32 connectTableIndex; // index of this entry in the connectTable
- PVCAddress pvc; // PVCAddress of this VC
- AALType aal; // AAL Type
- QOSClass qos; // QOS Class
- TrafficDesc traffic; // Traffic Descriptor
- UInt32 flags; // flags for this entry
- // either kVCIIn or kVCIout or both
- queue_t* rdq; // read queue for this VC
- struct _MinorDeviceTableEntry* parentMinorDevice; // parent MinorDeviceTableEntry
- struct _ConnectTableEntry* nextConnection; // next connection, if more than one present
- // for the parent MinorDeviceTableEntry
- struct _ConnectTableEntry* prevConnection; // previous connection, if more than one present
- // for the parent MinorDeviceTableEntry
-
- };
-
- /*
- * MinorDeviceTableEntry, one per stream
- */
- struct _MinorDeviceTableEntry {
- UInt32 minorTableIndex; // index of this entry in the minorDeviceTable
- UInt32 minorNum; // minor device number of this stream
- UInt32 dlstate; // DLPI state of this stream
- queue_t* rdq; // read queue for this stream
- UInt32 numConnections; // number of VCs currently enabled on this stream
- UInt32 useUDInd; // whether to use DL_UNITDATA_IND on this stream
- struct _ConnectTableEntry* firstConnection; // first ConnectTableEntry of this stream, no specific order
- UInt32 timeoutID; // id for bufcalls and timeouts
- UInt16 idType; // type of id (bufcall or timeout)
- };
-
- /*
- * PortPrivateData, one per port (i.e per card)
- * A global will be declared of this structure type.
- */
- struct _PortPrivateData {
- RegEntryID nodeEntryID; // our entry in the Name Registry
- TPortRecord* port; // our TPortRecord
- UInt8 ourPhyAddress[kATMPhysicalAddressLength]; // our ATM address
- UInt32 ourPeakCellRate; // peak user cell rate
- UInt32 numCardOpens; // number of streams open
- struct _MinorDeviceTableEntry** minorDeviceTable; // the table of all minor devices, i.e. streams
- struct _ConnectTableEntry** connectTable; // the table of all VCs
- UInt32 maxConnectTableIndex; // the current max. index in the connectTable
- UInt32 currentFwdPeakCellRateAllocated; // current max. user cell rate allocated
- // in the forward direction
- UInt32 currentBwdPeakCellRateAllocated; // current max. user cell rate allocated
- // in the backward direction
- SInt32 TxDeferredTaskCookie; // the transmit deferred task cookie
- SInt32 RxDeferredTaskCookie; // the transmit deferred task cookie
- struct _ABCVendorCardSpecific* cardSpecific; // vendor specific data for the atm card
- };
-
- typedef struct _ConnectTableEntry ConnectTableEntry;
- typedef struct _MinorDeviceTableEntry MinorDeviceTableEntry;
- typedef struct _PortPrivateData PortPrivateData;
-
- /***********************************************************
- EXTERNS
- ***********************************************************/
-
- extern void ATMDLPI_unitdata_ind(ConnectTableEntry* conn, UInt16 vpi, UInt16 vci, mblk_t* mp);
- extern ConnectTableEntry* find_connection(UInt16 vpi, UInt16 vci, UInt32 flags);
-
- #endif /* __ATMDLPI__ */
-